home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8955 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: dawn.mmm.com!news
  2. From: kjhopps@mmm.com (Kevin J Hopps)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to generate all the combinations of n numbers?
  5. Date: 27 Feb 1996 16:34:37 GMT
  6. Organization: 3M - St. Paul, MN  55144-1000 US
  7. Message-ID: <4gvbqt$rr4@dawn.mmm.com>
  8. References: <4giuc9$pq@news.cis.okstate.edu>
  9. Reply-To: kjhopps@mmm.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Madhav Kakani (kakani@osuunx.ucc.okstate.edu) wrote:
  13. > Hello everybody,
  14. >     I am having problems in writing a c/c++ program which
  15. > generates all possible combinations of n given numbers.
  16. > For example, if an array x has some numbers
  17. >  
  18. > int x[] = {1,2,3};
  19.  
  20. > the program should generate the following output:
  21. > 1
  22. > 2
  23. > 3
  24. > 12
  25. > 13
  26. > 23
  27. > 123
  28.  
  29. I think it would be wrong for us to do your homework for you.
  30. --
  31. Kevin J. Hopps                  e-mail: kjhopps@mmm.com
  32. 3M Company                      phone:  (612) 737-4643
  33. 3M Center, Bldg. 235-2D-57      fax:    (612) 737-2700
  34. St. Paul, MN 55144-1000         Opinions are my own.  I don't speak for 3M.
  35.     But 3M speaks for me -- I did not write the following line:
  36.  
  37. Opinions expressed herein are my own and may not represent those of 3M.
  38.